#!/bin/bash
set -e
set -x
MYDIR="${0%/*}"
cd "$MYDIR/.."
source "recipes/common.sh"


# RECIPE START fuse
reset_mtime fuse fuse/configure.ac
rm -rf build/fuse
mkdir -p build/fuse
cd build/fuse
env \
	MOUNT_FUSE_PATH=$prefix/bin \
	UDEV_RULES_PATH=$prefix/lib/udev/rules.d \
../../fuse/configure \
	${CONFIGURE_ARGS} \
	--disable-static \
	--disable-silent-rules \
	${AUTOCRAP_KLUDGE}

make -j${JOBS}
make install DESTDIR=`pwd`/inst
wipe_la_files `pwd`/inst
rm -rf inst/dev inst/etc

mkdir inst/etc
cat > inst/etc/fuse.conf <<-EOF
user_allow_other
user_allow_root
EOF

cd inst
find "${prefix#/}" etc | cpio -pumd "$stage"
cd ../../..
rm -rf build/fuse

# RECIPE END fuse
